The present invention relates to processors, and more specifically to processor testing. Advanced processors typically include branch predictors that try to guess before a conditional branch is actually executed whether a condition of the conditional branch will be satisfied. The purpose of the branch predictor is to improve the flow in the instruction pipeline. That is, by guessing which way a conditional branch will be resolved, the processor can begin loading the appropriate instructions in the pipeline before executing the conditional branch. Without branch prediction, the processor would have to wait until the branch instruction was executed before fetching the next instruction for the pipeline.
When a conditional branch is initially encountered, a processor has little information on which to predict the branch target. But the branch predictor can keep a record of whether a branch is taken or not taken. Thus, when it encounters a conditional branch that has been seen before, it can base the prediction on the past history.
Branch predictors in advanced processors are complex, and so is their testing. For example, the branch predictor can have micro architectural features, like a branch history table and an effective address table, to enhance the performance of the branch instructions. Thus, run-time tests need to be performed to validate that a processor is performing properly.